% plots the square distance of trap configurations against N^2

N = [2:65, 70:5:200];
v = zeros(1,length(N));
for i = 1:length(N)
    fileName = strcat('traps',num2str(N(i)),'.dat');
    [theta, phi] = loadTrapData(fileName);
    [x,y,z] = fromSphToCart(1, theta, phi);
    v(i) = squareDistance(x,y,z);
    % u(i) = trapEnergy(x,y,z);
end

plot(N,abs(v-N.^2));
%plot(N,v,N,N.^2,'--');
%legend('Sum of Square Distances','N^2');
xlabel('N');
